import React from 'react'
import './index.css'

/**
 * 学生表格
 *
 * @export
 * @return {*} 
 */
export default function StucentTable(props) {
    const trs = props.stus.map(s => <tr key={s.id}>
        <th>{s.sNo}</th>
        <th>{s.name}</th>
        <th>{s.sex}</th>
        <th>{s.birth}</th>
        <th>{s.email}</th>
        <th>
            <a href={`/studens/${s.sNo}`}>详情</a>
        </th>
    </tr>)
    return (
        <table className="tab">
            <thead>
                <tr>
                    <th>学号</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>出身日期</th>
                    <th>邮箱</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {trs}
            </tbody>
        </table>
    )
}
